/*package com.semidata.trp.frequency.redis;

import java.util.ArrayList;
import java.util.List;

import org.aredis.cache.AsyncRedisConnection;
import org.aredis.cache.RedisCommand;
import org.aredis.cache.RedisCommandInfo;

import com.semidata.rtd.core.datasource.DataSourceWriter;
import com.semidata.rtd.core.datasource.redis.RedisDataSource;

public class RedisWriter extends RedisCommon implements DataSourceWriter {

	final static Integer EXPIRE = 24 * 60 * 60;
	public RedisWriter(RedisDataSource datasource) {
		super(datasource);
		
	}
	
	public void write(String database, String key, Object value) {
		
		AsyncRedisConnection client = datasource.getClient(database,"");
//		System.out.println("client : " + client.getConnection().getHost());
		List<RedisCommandInfo> list = clientMap.get(client);
		if (list == null) {
			list = new ArrayList<RedisCommandInfo>();
			clientMap.put(client, list);
		}
		list.add(new RedisCommandInfo(RedisCommand.HSET, database, key, value));
		list.add(new RedisCommandInfo(RedisCommand.EXPIRE, database, EXPIRE));
		totalCommands.incrementAndGet();
	}

}
*/